<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .outer {
            width: 600px;
            height: 400px;
            margin: 100px auto;
            overflow: hidden;
        }
        .inner {
            width: 2400px;
            height: 400px;
            /*margin-left: -600px;*/
        }
        img {
            float: left;
            width: 600px;
            height: 400px;
        }
        .left {
            width: 100px;
            height: 100px;
        }
    </style>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<p></p>
<div class="outer">
    <div class="inner" id="inner">
            <img src="1.jpg">
            <img src="2.jpg">
            <img src="3.jpg">
            <img src="4.jpg">
    </div>
</div>
<div class="left">
            <button type="button" id="btn" class="glyphicon glyphicon-chevron-left"></button>
</div>
<script>
    var inner = document.getElementById('inner');
    var number = 0;
    var btn_left = document.getElementById('btn');
    var interval = setInterval(
        function () {
            if(number<-1800){
                number=0
            }else{
                number -= 5 ;
            }
            num = number + 'px';
            console.log(number);
            inner.style.marginLeft=num
        },50
    );
</script>
</body>
</html>